package HomeWork.Chapter04;

import java.util.Random;
import java.util.Scanner;

/**
 * Enjoy programming!!!
 * Time: 2021/11/16 -  20:50
 */
public class Test2 {
    public static void main(String[] args) {
        Random random = new Random();
        float t;
        CPU cpu = new CPU();
        Scanner scanner = new Scanner(System.in);
        String s;
        do {
            t = random.nextFloat() * 100;
            if (t <= 80)
                cpu.setTemp(t);
            s = scanner.nextLine();
            cpu.setSpeed(2200);
            HardDisk disk = new HardDisk();
            disk.setAmount(200);
            PC pc = new PC();
            pc.setCPU(cpu);
            pc.setHardDisk(disk);
            pc.show();
        }
        while (!s.contains("q"));


//        System.out.println(t);
    }
}

class HardDisk {
    private int amount;

    public int getAmount() {
        return amount;
    }

    public void setAmount(int m) {
        amount = m;
    }
}
